﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using SHKF.B2C.BLL.Center;
using SHKF.B2C.YouZanYun.Model.Inter.Organization;
using System; 
using System.Threading.Tasks;

namespace SHKF.B2C.YouZanYun.Service.Controllers
{
    [Route("[controller]")]
    [ApiController]
    public class ShopController : Base2Controller
    {
        private readonly ShopMapBLL shopMapBLL;

        public ShopController(
          ShopMapBLL shopMapBLL,
         IServiceProvider serviceProvider,
         ILogger<ShopController> logger) : base(serviceProvider, logger)
        {
            this.shopMapBLL = shopMapBLL;
        }

        [HttpGet("list")]
        public  async Task<OrganizationResult> List(int CompanySN)
        {
            long id = this.shopMapBLL.GetKdtId(CompanySN);
            await base.GetToken(id.ToString());
            OrganizationResult result = await this.httpClient.GetShopList(id.ToString());
            if (result.success)
            {
                
            }
            else
            {
                
            }

            return result;
        }
    }
}
